package org.jeecg.modules.logistics.table.user_xy.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.jeecg.modules.logistics.table.user_xy.entity.UserXy;
import org.jeecg.modules.logistics.table.user_xy.mapper.UserXyMapper;
import org.jeecg.modules.logistics.table.user_xy.service.IUserXyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 用户协议
 * @Author: tangxz
 * @Date:   2019-12-14
 * @Version: V1.0
 */
@Service
@DS("freight")
public class UserXyServiceImpl extends ServiceImpl<UserXyMapper, UserXy> implements IUserXyService {
    @Autowired
    UserXyMapper userXyMapper;

    @Override
    public List<UserXy> getAllUserXy() {
        return userXyMapper.getAllUserXy();
    }

    @Override
    public void delOneUserXy(int xyId) {
        userXyMapper.delOneUserXy(xyId);
    }

    @Override
    public void saveOneUserXy(UserXy userXy) {
        if (userXy.getXyId()!=null){
            userXyMapper.mdfOneUserXy(userXy);
        }else {
            userXyMapper.insertOnuUserXy(userXy);
        }
    }
}
